import Home from '../view/Home'
import About from '../view/About'
import My from '../view/My'
import Login from '../view/Login'
import One from '../view/One'
import Two from '../view/Two'
import { Navigate } from 'react-router-dom'
import { createBrowserRouter } from 'react-router-dom'
export const router = createBrowserRouter([
    {
        path: '/',
        element: <Navigate to={'/home'}></Navigate>
    },
    {
        path: '/home',
        element: <Home></Home>,

    }, {
        path: '/about',
        element: <About></About>,
        handle: {
            title: '分类'
        },
        children: [
            {
                path: '/about/one',
                element: <One></One>,
                handle: {
                    title: '搜索'
                },
                children: [
                    {
                        path: '/about/one/two',
                        element: <Two></Two>,
                        handle: {
                            title: '推荐'
                        }
                    },
                ]
            },
        ]

    }, {
        path: '/my',
        element: <My></My>,

    }, {
        path: '/login',
        element: <Login></Login>,

    },
])